//
//  ShipuCollectionViewCell.m
//  ThePrivateKitchen
//
//  Created by lirui on 16/1/20.
//  Copyright © 2016年 www.lanou3g.com蓝鸥科技. All rights reserved.
//

#import "ShipuCollectionViewCell.h"

@implementation ShipuCollectionViewCell
- (void)dealloc
{
    [_imgview release];
    [_title release];
    [super dealloc];
}
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        //imgview
        self.imgview = [[ UIImageView alloc] init];
        // _imgview.backgroundColor = [ UIColor redColor];
        [self.contentView addSubview:_imgview];
        [_imgview release];
        //titlel
        self.title =[[  UILabel alloc] init];
        // _title.backgroundColor = [ UIColor greenColor];
        [self.contentView addSubview:_title];
        [_title release];
        _title.font =[ UIFont systemFontOfSize:10];
        _title.textAlignment = NSTextAlignmentCenter;
        
    }
    return self;
}

//布局方法
- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    _imgview.frame = CGRectMake(0, 0, layoutAttributes.size.width -40*WIDTH, layoutAttributes.size.height);
    _title.frame = CGRectMake(-3*WIDTH, layoutAttributes.size.height , layoutAttributes.size.width -30 *WIDTH, 20 * HEIGHT);
}

@end
